<!--{template common/header}-->

<div id="pt" class="bm cl">
	<!--{subtemplate common/simplesearchform}-->
	<div class="z"><a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> <em>&rsaquo;</em> <a href="home.php">$_G[setting][navs][4][navname]</a> <em>&rsaquo;</em> <a href="home.php?mod=space&do=album">{lang album}</a> <em>&rsaquo;</em> {lang upload_pic}</div>
</div>

<div id="ct" class="ct2_a wp cl">
	<div class="mn">
		<div class="bm bw0">
			<h1 class="mt"><img alt="album" src="{STATICURL}image/feed/album.gif" class="vm" /> {lang album}</h1>
			<ul class="tb cl">
			<!--{if $albumid}-->
				<li><a href="home.php?mod=spacecp&ac=album&op=edit&albumid=$albumid">{lang edit_album_information}</a></li>
				<li><a href="home.php?mod=spacecp&ac=album&op=editpic&albumid=$albumid">{lang edit_pic}</a></li>
			<!--{/if}-->
				<li$actives[js]><a href="home.php?mod=spacecp&ac=upload&albumid=$albumid">{lang common_upload}</a></li>
				<li$actives[flash]><a href="home.php?mod=spacecp&ac=upload&op=flash&albumid=$albumid">{lang bulk_upload}</a></li>
				<li$actives[cam]><a href="home.php?mod=spacecp&ac=upload&op=cam&albumid=$albumid">{lang camera_pic}</a></li>
				<li class="y"><a href="home.php?mod=space&uid=$space[uid]&do=album&view=me">&laquo; {lang back_to_my_album}</a></li>
				<!--{if $_G['setting']['magicstatus'] && $_G['setting']['magics']['doodle']}-->
				<li class="y doodle"><a id="a_doodle" class="y" href="home.php?mod=magic&mid=doodle&showid=album_doodle&target=album_message&from=album" onclick="showWindow(this.id, this.href, 'get', '0')">{$_G[setting][magics][doodle]}</a></li>
				<!--{/if}-->
			</ul>
			
			<!--{if $haveattachsize}-->
			<div class="tbmu">
				{lang hava_attach_size} <strong>$haveattachsize</strong> (<a href="home.php?mod=spacecp&ac=upload&op=recount">{lang recount}</a>)
				<!--{if $_G['setting']['magicstatus'] && $_G[setting][magics][attachsize]}-->
				<br />
				<img src="{STATICURL}image/magic/attachsize.small.gif" alt="attachsize" class="vm" />
				<a id="a_magic_attachsize" href="home.php?mod=magic&mid=attachsize" onclick="showWindow('magics', this.href, 'get', 0)">{lang i_want_more_space}</a>
				({lang you_can_buy_magictools})
				<!--{/if}-->
			</div>
			<!--{/if}-->

		<!--{if empty($_GET['op'])}-->
			<h2 class="mtw xs2">1. {lang select_pic}</h2>
			<div class="xg1">{lang upload_pic_tips}</div>
			<div class="mtn ptw pbw bm bmn">
				<table cellspacing="0" cellpadding="0" class="tfm">
					<tbody id="attachbodyhidden" style="display:none">
						<tr>
							<td>
								<form method="post" autocomplete="off" id="upload" action="home.php?mod=spacecp&ac=upload" enctype="multipart/form-data" target="uploadframe">
									<input type="file" name="attach" size="0" class="pf" style="height: 26px;" />
									<span id="localfile"></span>
									<input type="hidden" name="uploadsubmit" id="uploadsubmit" value="true" />
									<input type="hidden" name="albumid" id="albumid" value="0" />
									<input type="hidden" name="topicid" id="topicid" value="0" />
									<input type="hidden" name="formhash" value="{FORMHASH}" />
								</form>
							</td>
						</tr>
					</tbody>
					<tbody id="attachbody"></tbody>
				</table>
			</div>

			<script type="text/javascript">
				var check = false;
				no_insert = 1;
				function a_addOption() {
					var obj = $('uploadalbum');
					obj.value = 'addoption';
					addOption(obj);
				}

				function album_op(id) {
					$('selectalbum').style.display = 'none';
					$('creatalbum').style.display = 'none';
					$(id).style.display = '';
					check = false;
					if(id == 'creatalbum') {
						check = true;
						$('albumname').select();
					}
				}
			</script>

			<script src="{$_G[setting][jspath]}home_uploadpic.js?{VERHASH}" type="text/javascript"></script>
			<iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>

			<form method="post" autocomplete="off" id="albumform" action="home.php?mod=spacecp&ac=upload" target="uploadframe" onsubmit="return validate(this);">
				<h2 class="mtw xs2">2. {lang select_album}</h2>
				<div class="mtn ptw pbw bm bmn">
					<!--{if $albums}-->
					<p class="hm pbw xs2 xw1">
						<label for="albumop_selectalbum"><input type="radio" id="albumop_selectalbum" name="albumop" class="pr" value="selectalbum" checked="checked" onclick="album_op(this.value);" /> {lang add_to_existing_album}</label><span class="pipe">|</span><label for="albumop_creatalbum"><input type="radio" id="albumop_creatalbum" name="albumop" class="pr" value="creatalbum" onclick="album_op(this.value);" /> {lang create_new_album}</label>
					</p>
					<div id="selectalbum" class="hm">
						{lang select_album}
						<select name="albumid" id="uploadalbumid">
						<!--{loop $albums $value}-->
							<!--{if $value['albumid'] == $_GET['albumid']}-->
								<option value="$value[albumid]" selected="selected">$value[albumname]</option>
							<!--{else}-->
								<option value="$value[albumid]">$value[albumname]</option>
							<!--{/if}-->
						<!--{/loop}-->
						</select>
					</div>
					<div id="creatalbum" style="display:none;">
					<!--{else}-->
					<p class="hm pbw xs2 xw1">{lang create_new_album}</p>
					<input type="hidden" name="albumop" value="creatalbum" />
					<div id="creatalbum">
					<!--{/if}-->
						<table cellspacing="0" cellpadding="0" class="tfm">
							<tr>
								<th>{lang album_name}</th>
								<td><input type="text" class="px" size="20" id="albumname" name="albumname" value="{lang my_album}" /></td>
							</tr>
							<!--{if $_G['setting']['albumcategorystat'] && $categoryselect}-->
							<tr>
								<th>{lang site_categories}</th>
								<td>
									$categoryselect
									({lang select_site_album_categories})
								</td>
							</tr>
							<!--{/if}-->
							<tr>
								<th>{lang privacy_settings}</th>
								<td>
									<select name="friend" id="uploadfriend" onchange="passwordShow(this.value);" class="ps">
										<option value="0">{lang friendname_0}</option>
										<option value="1">{lang friendname_1}</option>
										<option value="2">{lang friendname_2}</option>
										<option value="3">{lang friendname_3}</option>
										<option value="4">{lang friendname_4}</option>
									</select>
								</td>
							</tr>
							<tbody id="span_password" style="display:none;">
								<tr>
									<th>{lang password}</th>
									<td><input type="text" id="uploadpassword" name="password" value="" size="10" class="px" /></td>
								</tr>
							</tbody>
							<tbody id="tb_selectgroup" style="display:none;">
								<tr>
									<th>{lang specified_friends}</th>
									<td>
										<select name="selectgroup" onchange="getgroup(this.value);">
										<option value="">{lang from_friends_group}</option>
										<!--{loop $groups $key $value}-->
										<option value="$key">$value</option>
										<!--{/loop}-->
										</select>
										<p class="d">{lang choices_following_friends_list}</p>
									</td>
								</tr>
								<tr>
									<th>&nbsp;</th>
									<td>
										<textarea name="target_names" id="target_names" rows="3" class="pt"></textarea>
										<p class="d">{lang friend_name_space}
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="mtm hm">
					<input type="hidden" name="albumsubmit" id="albumsubmit" value="true" />
					<button type="submit" name="uploadsubmit" id="btnupload" value="true"{if $_G['setting']['albumcategoryrequired']} onclick="return validate(this);"{/if} class="pn"><strong>{lang upload_start}</strong></button>
					<input type="hidden" name="formhash" value="{FORMHASH}" />
				</div>
			</form>
			<!--{if empty($albums)}-->
			<script type="text/javascript">
				if(typeof $('albumname') == 'object') {
					$('albumname').select();
				}
			</script>
			<!--{/if}-->
			<script type="text/javascript">
				function validate(obj) {
					if($('attachbody').getElementsByTagName('form').length <= 1) {
						showDialog('{lang select_upload_pic}', 'notice', '{lang reminder}', null, 0);
						if($('attach_0')) {
							$('attach_0').focus();
						}
						return false;
					}
			<!--{if $_G['setting']['albumcategorystat'] && $_G['setting']['albumcategoryrequired']}-->
					var catObj = $("catid");
					if(catObj && check) {
						if (catObj.value < 1) {
							showDialog('{lang select_system_cat}', 'notice', '{lang reminder}', null, 0);
							catObj.focus();
							return false;
						}
					}
			<!--{/if}-->
					return true;
				}
			</script>
			<form method="post" autocomplete="off" id="albumresultform" action="home.php?mod=spacecp&ac=upload">
				<input type="hidden" name="opalbumid" id="opalbumid" value="0" />
				<input type="hidden" name="viewAlbumid" id="viewAlbumid" value="true" />
				<input type="hidden" name="formhash" value="{FORMHASH}" />
			</form>

		<!--{elseif $_GET['op'] == 'cam'}-->
		</div>
		<div class="bm">
			<script type="text/javascript">
				document.write(AC_FL_RunContent(
					'width', '100%', 'height', '415',
					'src', '{IMGDIR}/cam.swf?config=$config&albumid=$_GET[albumid]',
					'quality', 'high', 'wmode', 'transparent'
				));
			</script>
		<!--{else}-->

		</div>
		<div class="bm">
			<script type="text/javascript">
				document.write(AC_FL_RunContent(
					'width', '100%', 'height', '400',
					'src', '{IMGDIR}/album_upload.swf?config=$config&albumid=$_GET[albumid]',
					'quality', 'high', 'wmode', 'transparent'
				));
			</script>

		<!--{/if}-->

		</div>
	</div>
	<div class="appl">
		<!--{subtemplate common/userabout}-->
	</div>
</div>

<!--{template common/footer}-->